home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / comms / other / magicfile / viruszfilecheck.rx < prev    next >
Text File  |  1999-04-21  |  2KB  |  62 lines

  1. /* 
  2.    $VER: MagicFile 4.5 VirusZ Virus Checker AREXX ©1997 Steve Clack 1.3
  3.    
  4.    This may be freely distributed and mutated!
  5.       
  6.    Template: FileCheck.rx <no arguments yet>
  7.         
  8.    If VirusZ is not running, it will be started from the script.
  9. */
  10.  
  11. Prog_VirusZ = "SYS:System/VirusZ/VirusZ" /* << Change this to where your VirusZ is! */
  12.  
  13. options results
  14. options failat 99
  15.  
  16. if ~show(ports,VIRUSZ_II.REXX) then do
  17.      address command Prog_VirusZ
  18.      StartTime = time(seconds)
  19.      do while ~show(ports,VIRUSZ_II.REXX)
  20.           if time(seconds) - StartTime > 20 then do
  21.                address command 'Echo >>BBS:Logfiles/MFVirusLog.text "'Time()' 'Date()' serious problem occoured:"'
  22.                address command 'Echo >>BBS:Logfiles/MFVirusLog.text "Failed to load VirusZ! Files have been untouched!*n"'
  23.                exit
  24.           end
  25.      end
  26. end
  27.  
  28. call open(checkfile,'T:MFCheckQueue',R)
  29. DO UNTIL EOF(checkfile)
  30.   Line = READLN(checkfile)
  31.   IF UPPER(WORD(Line,1)) = "%" THEN DO
  32.    USERNAME = READLN(checkfile)
  33.    DESTPATH = READLN(checkfile)
  34.    Line = READLN(checkfile)
  35.   END
  36.  
  37.   IF Line ~= "" then do
  38.    address VIRUSZ_II.REXX CHECKFILE Line DECREXEC DECRDATA USEEXTERN EXTRACT
  39.    status = rc
  40.    
  41.    if status=10 then do
  42.       address command 'Echo >>BBS:Logfiles/MFVirusLog.text "'Time()' 'Date()' serious problem occoured:"'
  43.       address command 'Echo >>BBS:Logfiles/MFVirusLog.text "Failed to virus check >'Line'< uploaded by 'USERNAME'!*n"'
  44.       address command 'Copy CLONE >nil: 'Line' 'DESTPATH
  45.    end
  46.    
  47.    if status=0 then do
  48.       address command 'Copy CLONE >nil: 'Line' 'DESTPATH
  49.    end
  50.  
  51.    if status=5 then do
  52.       address command 'Echo >>BBS:Logfiles/MFVirusLog.text "'Time()' 'Date()' incident occoured:"'
  53.       address command 'Echo >>BBS:Logfiles/MFVirusLog.text "'USERNAME' uploaded virus infected >'Line'< - file nuked!*n"'
  54.    end
  55.  
  56.   address command 'Delete >nil: 'Line
  57.   END
  58. END
  59. call close checkfile
  60. address command 'Delete >nil: T:MFCheckQueue'
  61. exit
  62.